<%@ page import="news.service.IQueryTopicService" %>
<%@ page import="news.service.QueryTopicServiceImpl" %>
<%@ page import="news.example.Topic" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="news.service.IQueryNewsListService" %>
<%@ page import="news.service.QueryNewsListServiceImpl" %>
<%@ page import="news.example.News" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<style>
    .tool{
        overflow: auto;
    }
    .title{
        font-size: 20px;
        font-weight: bolder;
    }
    .con{
        font-size: 18px;
        line-height: 25px;
    }
    .news{
        margin-top: 15px;
    }
    .foot{
        font-size: 18px;
        margin-top: 10px;
    }
    .foot a{
        text-decoration: none;
    }
</style>

<%
    IQueryNewsListService iQueryNewsListService = new QueryNewsListServiceImpl();
    IQueryTopicService iQueryTopicService = new QueryTopicServiceImpl();
    List<News> list = iQueryNewsListService.findAll();
    String newsTitle ="";
    String newsAuthor="";
    int newsId ;
%>
<div class="tool">
    <p class="title">新闻列表</p>
    <div class="news">
    <form method="post" action="">
        <%
            for (int i = 0; i < list.size(); i++) {
                newsTitle = list.get(i).getTitle();
                newsId = list.get(i).getId();
                newsAuthor = list.get(i).getUsername();

        %>
        <p class="con">·
            <%
                out.print(newsTitle+"\t"+"作者:"+newsAuthor); %>
        </p>
        <%
            }
        %>
    </div>
    <div class="foot">
        当前页:1
        每页:10
        总页:5
        <br>
        <a href="/">首页</a>
        <a href="/">上页</a>
        <a href="/">下页</a>
        <a href="/">尾页</a>
    </div>
    </form>
</div>
